home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / GCC / CLIB / !clib / h / setjmp < prev    next >
Text File  |  1997-03-22  |  1KB  |  41 lines

  1. /* setjmp.h
  2.  
  3.    For use with the GNU compilers and the SharedCLibrary.
  4.    (c) Copyright 1997, Nick Burrett.  */
  5.  
  6. #ifndef __SETJMP_H
  7. #define __SETJMP_H
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. /* Objects of type jmp_buf hold the state information to be
  14.    restored by a non-local exit.  */
  15. #ifdef __JMP_BUF_SIZE
  16. typedef int jmp_buf[__JMP_BUF_SIZE];
  17. #else
  18. typedef int jmp_buf[21];
  19. #endif
  20.  
  21. /* setjmp stores information about the execution state of the
  22.    program in 'state' and returns zero.  If longjmp is later
  23.    used to perform a non-local exit to this 'state', setjmp
  24.    returns a nonzero value.  */
  25. #ifdef __STDC__
  26. #define setjmp(jmp_buf) (setjmp(jmp_buf))
  27. #endif
  28. extern int setjmp (jmp_buf state);
  29.  
  30. /* Restore the current execution to the state saved in 'state'.
  31.    Returning from setjmp by means of longjmp returns 'value'
  32.    argument that was passed to longjmp rather than 0.  If 'value'
  33.    is 0, setjmp returns 1.  */
  34. extern void longjmp (jmp_buf state, int value);
  35.  
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39.  
  40. #endif
  41.